﻿// ReSharper disable ArrangeObjectCreationWhenTypeEvident
// ReSharper disable BuiltInTypeReferenceStyle
// ReSharper disable ConvertToAutoProperty
// ReSharper disable InconsistentNaming
// ReSharper disable PartialTypeWithSinglePart
// ReSharper disable PreferConcreteValueOverDefault
// ReSharper disable RedundantNameQualifier
// ReSharper disable SuggestVarOrType_SimpleTypes
// ReSharper disable UnusedMember.Global
// ReSharper disable UnusedMethodReturnValue.Local
// ReSharper disable UnusedType.Global

// UploadScalarClient

// <auto-generated/>
#nullable enable annotations
#nullable disable warnings

namespace Microsoft.Extensions.DependencyInjection
{
    // StrawberryShake.CodeGeneration.CSharp.Generators.DependencyInjectionGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public static partial class UploadScalarClientServiceCollectionExtensions
    {
        public static global::StrawberryShake.IClientBuilder<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.State.UploadScalarClientStoreAccessor> AddUploadScalarClient(this global::Microsoft.Extensions.DependencyInjection.IServiceCollection services, global::StrawberryShake.ExecutionStrategy strategy = global::StrawberryShake.ExecutionStrategy.NetworkOnly)
        {
            var serviceCollection = new global::Microsoft.Extensions.DependencyInjection.ServiceCollection();
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp =>
            {
                ConfigureClientDefault(sp, serviceCollection, strategy);
                return new ClientServiceProvider(global::Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(serviceCollection));
            });
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => new global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.State.UploadScalarClientStoreAccessor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IOperationStore>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IEntityStore>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IEntityIdSerializer>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationRequestFactory>>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationResultDataFactory>>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp))));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestUploadQuery>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadQuery>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.UploadScalarClient>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.IUploadScalarClient>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)));
            return new global::StrawberryShake.ClientBuilder<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.State.UploadScalarClientStoreAccessor>("UploadScalarClient", services, serviceCollection);
        }

        private static global::Microsoft.Extensions.DependencyInjection.IServiceCollection ConfigureClientDefault(global::System.IServiceProvider parentServices, global::Microsoft.Extensions.DependencyInjection.ServiceCollection services, global::StrawberryShake.ExecutionStrategy strategy = global::StrawberryShake.ExecutionStrategy.NetworkOnly)
        {
            global::Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddSingleton<global::StrawberryShake.IEntityStore, global::StrawberryShake.EntityStore>(services);
            global::Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddSingleton<global::StrawberryShake.IOperationStore>(services, sp => new global::StrawberryShake.OperationStore(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IEntityStore>(sp)));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Transport.Http.IHttpConnection>(services, sp =>
            {
                var clientFactory = global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Net.Http.IHttpClientFactory>(parentServices);
                return new global::StrawberryShake.Transport.Http.HttpConnection(() => clientFactory.CreateClient("UploadScalarClient"));
            });
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.UploadSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.StringSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.BooleanSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.ByteSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.ShortSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.IntSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.LongSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.FloatSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.DecimalSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.UrlSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.UUIDSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.IdSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.DateTimeSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.DateSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.LocalDateSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.LocalDateTimeSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.LocalTimeSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.ByteArraySerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.TimeSpanSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.JsonSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInputInputValueFormatter>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.BarInputInputValueFormatter>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.BazInputInputValueFormatter>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializerResolver>(services, sp => new global::StrawberryShake.Serialization.SerializerResolver(global::System.Linq.Enumerable.Concat(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Collections.Generic.IEnumerable<global::StrawberryShake.Serialization.ISerializer>>(parentServices), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Collections.Generic.IEnumerable<global::StrawberryShake.Serialization.ISerializer>>(sp))));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationResultDataFactory<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadResult>, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.State.TestUploadResultFactory>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationResultDataFactory>(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IOperationResultDataFactory<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadResult>>(sp));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationRequestFactory>(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadQuery>(sp));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationResultBuilder<global::System.Text.Json.JsonDocument, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadResult>, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.State.TestUploadBuilder>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationExecutor<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadResult>>(services, sp => new global::StrawberryShake.OperationExecutor<global::System.Text.Json.JsonDocument, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadResult>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.Transport.Http.IHttpConnection>(sp), () => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IOperationResultBuilder<global::System.Text.Json.JsonDocument, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadResult>>(sp), () => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IResultPatcher<global::System.Text.Json.JsonDocument>>(sp), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IOperationStore>(sp), strategy));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IResultPatcher<global::System.Text.Json.JsonDocument>, global::StrawberryShake.Json.JsonResultPatcher>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestUploadQuery>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadQuery>(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestUploadQuery>(sp));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IEntityIdSerializer, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.State.UploadScalarClientEntityIdFactory>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.UploadScalarClient>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.IUploadScalarClient>(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.UploadScalarClient>(sp));
            return services;
        }

        private sealed class ClientServiceProvider : System.IServiceProvider, System.IDisposable
        {
            private readonly System.IServiceProvider _provider;
            public ClientServiceProvider(System.IServiceProvider provider)
            {
                _provider = provider;
            }

            public object? GetService(System.Type serviceType)
            {
                return _provider.GetService(serviceType);
            }

            public void Dispose()
            {
                if (_provider is System.IDisposable d)
                {
                    d.Dispose();
                }
            }
        }
    }
}

namespace StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar
{
    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultTypeGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class TestUploadResult : global::System.IEquatable<TestUploadResult>, ITestUploadResult
    {
        public TestUploadResult(global::System.String? upload)
        {
            Upload = upload;
        }

        public global::System.String? Upload { get; }

        public virtual global::System.Boolean Equals(TestUploadResult? other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            if (other.GetType() != GetType())
            {
                return false;
            }

            return (((Upload is null && other.Upload is null) || Upload != null && Upload.Equals(other.Upload)));
        }

        public override global::System.Boolean Equals(global::System.Object? obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            if (ReferenceEquals(this, obj))
            {
                return true;
            }

            if (obj.GetType() != GetType())
            {
                return false;
            }

            return Equals((TestUploadResult)obj);
        }

        public override global::System.Int32 GetHashCode()
        {
            unchecked
            {
                int hash = 5;
                if (Upload != null)
                {
                    hash ^= 397 * Upload.GetHashCode();
                }

                return hash;
            }
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial interface ITestUploadResult
    {
        public global::System.String? Upload { get; }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.InputValueFormatterGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class TestInputInputValueFormatter : global::StrawberryShake.Serialization.IInputObjectFormatter
    {
        private global::StrawberryShake.Serialization.IInputValueFormatter _barInputFormatter = default !;
        public global::System.String TypeName => "TestInput";

        public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver)
        {
            _barInputFormatter = serializerResolver.GetInputValueFormatter("BarInput");
        }

        public global::System.Object? Format(global::System.Object? runtimeValue)
        {
            if (runtimeValue is null)
            {
                return null;
            }

            var input = runtimeValue as global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput;
            var inputInfo = runtimeValue as global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.State.ITestInputInfo;
            if (input is null || inputInfo is null)
            {
                throw new global::System.ArgumentException(nameof(runtimeValue));
            }

            var fields = new global::System.Collections.Generic.List<global::System.Collections.Generic.KeyValuePair<global::System.String, global::System.Object?>>();
            if (inputInfo.IsBarSet)
            {
                fields.Add(new global::System.Collections.Generic.KeyValuePair<global::System.String, global::System.Object?>("bar", FormatBar(input.Bar)));
            }

            return fields;
        }

        private global::System.Object? FormatBar(global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.BarInput? input)
        {
            if (input is null)
            {
                return input;
            }
            else
            {
                return _barInputFormatter.Format(input);
            }
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.InputTypeGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "0.0.0.0")]
    public partial class TestInput : global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.State.ITestInputInfo, global::System.IEquatable<TestInput>
    {
        public override global::System.Boolean Equals(global::System.Object? obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            if (ReferenceEquals(this, obj))
            {
                return true;
            }

            if (obj.GetType() != GetType())
            {
                return false;
            }

            return Equals((TestInput)obj);
        }

        public virtual global::System.Boolean Equals(TestInput? other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            if (other.GetType() != GetType())
            {
                return false;
            }

            return (((Bar is null && other.Bar is null) || Bar != null && Bar.Equals(other.Bar)));
        }

        public override global::System.Int32 GetHashCode()
        {
            unchecked
            {
                int hash = 5;
                if (Bar != null)
                {
                    hash ^= 397 * Bar.GetHashCode();
                }

                return hash;
            }
        }

        private global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.BarInput? _value_bar;
        private global::System.Boolean _set_bar;
        public global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.BarInput? Bar
        {
            get => _value_bar;
            set
            {
                _set_bar = true;
                _value_bar = value;
            }
        }

        global::System.Boolean global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.State.ITestInputInfo.IsBarSet => _set_bar;
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.InputValueFormatterGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class BarInputInputValueFormatter : global::StrawberryShake.Serialization.IInputObjectFormatter
    {
        private global::StrawberryShake.Serialization.IInputValueFormatter _bazInputFormatter = default !;
        public global::System.String TypeName => "BarInput";

        public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver)
        {
            _bazInputFormatter = serializerResolver.GetInputValueFormatter("BazInput");
        }

        public global::System.Object? Format(global::System.Object? runtimeValue)
        {
            if (runtimeValue is null)
            {
                return null;
            }

            var input = runtimeValue as global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.BarInput;
            var inputInfo = runtimeValue as global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.State.IBarInputInfo;
            if (input is null || inputInfo is null)
            {
                throw new global::System.ArgumentException(nameof(runtimeValue));
            }

            var fields = new global::System.Collections.Generic.List<global::System.Collections.Generic.KeyValuePair<global::System.String, global::System.Object?>>();
            if (inputInfo.IsBazSet)
            {
                fields.Add(new global::System.Collections.Generic.KeyValuePair<global::System.String, global::System.Object?>("baz", FormatBaz(input.Baz)));
            }

            return fields;
        }

        private global::System.Object? FormatBaz(global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.BazInput? input)
        {
            if (input is null)
            {
                return input;
            }
            else
            {
                return _bazInputFormatter.Format(input);
            }
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.InputTypeGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "0.0.0.0")]
    public partial class BarInput : global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.State.IBarInputInfo, global::System.IEquatable<BarInput>
    {
        public override global::System.Boolean Equals(global::System.Object? obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            if (ReferenceEquals(this, obj))
            {
                return true;
            }

            if (obj.GetType() != GetType())
            {
                return false;
            }

            return Equals((BarInput)obj);
        }

        public virtual global::System.Boolean Equals(BarInput? other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            if (other.GetType() != GetType())
            {
                return false;
            }

            return (((Baz is null && other.Baz is null) || Baz != null && Baz.Equals(other.Baz)));
        }

        public override global::System.Int32 GetHashCode()
        {
            unchecked
            {
                int hash = 5;
                if (Baz != null)
                {
                    hash ^= 397 * Baz.GetHashCode();
                }

                return hash;
            }
        }

        private global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.BazInput? _value_baz;
        private global::System.Boolean _set_baz;
        public global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.BazInput? Baz
        {
            get => _value_baz;
            set
            {
                _set_baz = true;
                _value_baz = value;
            }
        }

        global::System.Boolean global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.State.IBarInputInfo.IsBazSet => _set_baz;
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.InputValueFormatterGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class BazInputInputValueFormatter : global::StrawberryShake.Serialization.IInputObjectFormatter
    {
        private global::StrawberryShake.Serialization.IInputValueFormatter _uploadFormatter = default !;
        public global::System.String TypeName => "BazInput";

        public void Initialize(global::StrawberryShake.Serialization.ISerializerResolver serializerResolver)
        {
            _uploadFormatter = serializerResolver.GetInputValueFormatter("Upload");
        }

        public global::System.Object? Format(global::System.Object? runtimeValue)
        {
            if (runtimeValue is null)
            {
                return null;
            }

            var input = runtimeValue as global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.BazInput;
            var inputInfo = runtimeValue as global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.State.IBazInputInfo;
            if (input is null || inputInfo is null)
            {
                throw new global::System.ArgumentException(nameof(runtimeValue));
            }

            var fields = new global::System.Collections.Generic.List<global::System.Collections.Generic.KeyValuePair<global::System.String, global::System.Object?>>();
            if (inputInfo.IsFileSet)
            {
                fields.Add(new global::System.Collections.Generic.KeyValuePair<global::System.String, global::System.Object?>("file", FormatFile(input.File)));
            }

            return fields;
        }

        private global::System.Object? FormatFile(global::StrawberryShake.Upload? input)
        {
            if (input is null)
            {
                return input;
            }
            else
            {
                return _uploadFormatter.Format(input);
            }
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.InputTypeGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "0.0.0.0")]
    public partial class BazInput : global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.State.IBazInputInfo, global::System.IEquatable<BazInput>
    {
        public override global::System.Boolean Equals(global::System.Object? obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            if (ReferenceEquals(this, obj))
            {
                return true;
            }

            if (obj.GetType() != GetType())
            {
                return false;
            }

            return Equals((BazInput)obj);
        }

        public virtual global::System.Boolean Equals(BazInput? other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            if (other.GetType() != GetType())
            {
                return false;
            }

            return (((File is null && other.File is null) || File != null && File.Equals(other.File)));
        }

        public override global::System.Int32 GetHashCode()
        {
            unchecked
            {
                int hash = 5;
                if (File != null)
                {
                    hash ^= 397 * File.GetHashCode();
                }

                return hash;
            }
        }

        private global::StrawberryShake.Upload? _value_file;
        private global::System.Boolean _set_file;
        public global::StrawberryShake.Upload? File
        {
            get => _value_file;
            set
            {
                _set_file = true;
                _value_file = value;
            }
        }

        global::System.Boolean global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.State.IBazInputInfo.IsFileSet => _set_file;
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.OperationDocumentGenerator
    /// <summary>
    /// Represents the operation service of the TestUpload GraphQL operation
    /// <code>
    /// query TestUpload(
    ///   $nonUpload: String
    ///   $single: Upload
    ///   $list: [Upload]
    ///   $nested: [[Upload]]
    ///   $object: TestInput
    ///   $objectList: [TestInput]
    ///   $objectNested: [[TestInput]]
    /// ) {
    ///   upload(nonUpload: $nonUpload, single: $single, list: $list, nested: $nested, object: $object, objectList: $objectList, objectNested: $objectNested)
    /// }
    /// </code>
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class TestUploadQueryDocument : global::StrawberryShake.IDocument
    {
        private TestUploadQueryDocument()
        {
        }

        public static TestUploadQueryDocument Instance { get; } = new TestUploadQueryDocument();
        public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query;
        public global::System.ReadOnlySpan<global::System.Byte> Body => "query TestUpload($nonUpload: String, $single: Upload, $list: [Upload], $nested: [[Upload]], $object: TestInput, $objectList: [TestInput], $objectNested: [[TestInput]]) { upload(nonUpload: $nonUpload, single: $single, list: $list, nested: $nested, object: $object, objectList: $objectList, objectNested: $objectNested) }"u8;
        public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "7cd8f1db7bb9937a9b48c70ce9dc152f52782f96");

        public override global::System.String ToString()
        {
#if NETCOREAPP3_1_OR_GREATER
        return global::System.Text.Encoding.UTF8.GetString(Body);
#else
            return global::System.Text.Encoding.UTF8.GetString(Body.ToArray());
#endif
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.OperationServiceGenerator
    /// <summary>
    /// Represents the operation service of the TestUpload GraphQL operation
    /// <code>
    /// query TestUpload(
    ///   $nonUpload: String
    ///   $single: Upload
    ///   $list: [Upload]
    ///   $nested: [[Upload]]
    ///   $object: TestInput
    ///   $objectList: [TestInput]
    ///   $objectNested: [[TestInput]]
    /// ) {
    ///   upload(nonUpload: $nonUpload, single: $single, list: $list, nested: $nested, object: $object, objectList: $objectList, objectNested: $objectNested)
    /// }
    /// </code>
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class TestUploadQuery : global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadQuery
    {
        private readonly global::StrawberryShake.IOperationExecutor<ITestUploadResult> _operationExecutor;
        private readonly global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter;
        private readonly global::StrawberryShake.Serialization.IInputValueFormatter _uploadFormatter;
        private readonly global::StrawberryShake.Serialization.IInputValueFormatter _testInputFormatter;
        private readonly global::System.Collections.Immutable.ImmutableArray<global::System.Action<global::StrawberryShake.OperationRequest>> _configure = global::System.Collections.Immutable.ImmutableArray<global::System.Action<global::StrawberryShake.OperationRequest>>.Empty;
        public TestUploadQuery(global::StrawberryShake.IOperationExecutor<ITestUploadResult> operationExecutor, global::StrawberryShake.Serialization.ISerializerResolver serializerResolver)
        {
            _operationExecutor = operationExecutor ?? throw new global::System.ArgumentNullException(nameof(operationExecutor));
            _stringFormatter = serializerResolver.GetInputValueFormatter("String");
            _uploadFormatter = serializerResolver.GetInputValueFormatter("Upload");
            _testInputFormatter = serializerResolver.GetInputValueFormatter("TestInput");
        }

        private TestUploadQuery(global::StrawberryShake.IOperationExecutor<ITestUploadResult> operationExecutor, global::System.Collections.Immutable.ImmutableArray<global::System.Action<global::StrawberryShake.OperationRequest>> configure, global::StrawberryShake.Serialization.IInputValueFormatter @stringFormatter, global::StrawberryShake.Serialization.IInputValueFormatter testInputFormatter, global::StrawberryShake.Serialization.IInputValueFormatter uploadFormatter)
        {
            _operationExecutor = operationExecutor;
            _configure = configure;
            _stringFormatter = @stringFormatter;
            _testInputFormatter = testInputFormatter;
            _uploadFormatter = uploadFormatter;
        }

        global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ITestUploadResult);

        public global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadQuery With(global::System.Action<global::StrawberryShake.OperationRequest> configure)
        {
            return new global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestUploadQuery(_operationExecutor, _configure.Add(configure), _stringFormatter, _testInputFormatter, _uploadFormatter);
        }

        public global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadQuery WithRequestUri(global::System.Uri requestUri)
        {
            return With(r => r.ContextData["StrawberryShake.Transport.Http.HttpConnection.RequestUri"] = requestUri);
        }

        public global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadQuery WithHttpClient(global::System.Net.Http.HttpClient httpClient)
        {
            return With(r => r.ContextData["StrawberryShake.Transport.Http.HttpConnection.HttpClient"] = httpClient);
        }

        public async global::System.Threading.Tasks.Task<global::StrawberryShake.IOperationResult<ITestUploadResult>> ExecuteAsync(global::System.String? nonUpload, global::StrawberryShake.Upload? single, global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.Upload?>? list, global::System.Collections.Generic.IReadOnlyList<global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.Upload?>?>? nested, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput? @object, global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput?>? objectList, global::System.Collections.Generic.IReadOnlyList<global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput?>?>? objectNested, global::System.Threading.CancellationToken cancellationToken = default)
        {
            var request = CreateRequest(nonUpload, single, list, nested, @object, objectList, objectNested);
            foreach (var configure in _configure)
            {
                configure(request);
            }

            return await _operationExecutor.ExecuteAsync(request, cancellationToken).ConfigureAwait(false);
        }

        private void MapFilesFromArgumentSingle(global::System.String path, global::StrawberryShake.Upload? value, global::System.Collections.Generic.Dictionary<global::System.String, global::StrawberryShake.Upload?> files)
        {
            files.Add(path, value is global::StrawberryShake.Upload u ? u : null);
        }

        private void MapFilesFromArgumentList(global::System.String path, global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.Upload?>? value, global::System.Collections.Generic.Dictionary<global::System.String, global::StrawberryShake.Upload?> files)
        {
            if (value is { } value_i)
            {
                var path_counter = 0;
                foreach (var value_lt in value_i)
                {
                    var path_lt = path + "." + (path_counter++);
                    files.Add(path_lt, value_lt is global::StrawberryShake.Upload u ? u : null);
                }
            }
        }

        private void MapFilesFromArgumentNested(global::System.String path, global::System.Collections.Generic.IReadOnlyList<global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.Upload?>?>? value, global::System.Collections.Generic.Dictionary<global::System.String, global::StrawberryShake.Upload?> files)
        {
            if (value is { } value_i)
            {
                var path_counter = 0;
                foreach (var value_lt in value_i)
                {
                    var path_lt = path + "." + (path_counter++);
                    if (value_lt is { } value_lt_i)
                    {
                        var path_lt_counter = 0;
                        foreach (var value_lt_lt in value_lt_i)
                        {
                            var path_lt_lt = path_lt + "." + (path_lt_counter++);
                            files.Add(path_lt_lt, value_lt_lt is global::StrawberryShake.Upload u ? u : null);
                        }
                    }
                }
            }
        }

        private void MapFilesFromTypeTestInput(global::System.String path, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput value, global::System.Collections.Generic.Dictionary<global::System.String, global::StrawberryShake.Upload?> files)
        {
            var pathBar = path + ".bar";
            var valueBar = value.Bar;
            if (valueBar is { } valueBar_i)
            {
                MapFilesFromTypeBarInput(pathBar, valueBar_i, files);
            }
        }

        private void MapFilesFromTypeBarInput(global::System.String path, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.BarInput value, global::System.Collections.Generic.Dictionary<global::System.String, global::StrawberryShake.Upload?> files)
        {
            var pathBaz = path + ".baz";
            var valueBaz = value.Baz;
            if (valueBaz is { } valueBaz_i)
            {
                MapFilesFromTypeBazInput(pathBaz, valueBaz_i, files);
            }
        }

        private void MapFilesFromTypeBazInput(global::System.String path, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.BazInput value, global::System.Collections.Generic.Dictionary<global::System.String, global::StrawberryShake.Upload?> files)
        {
            var pathFile = path + ".file";
            var valueFile = value.File;
            files.Add(pathFile, valueFile is global::StrawberryShake.Upload u ? u : null);
        }

        private void MapFilesFromArgumentObject(global::System.String path, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput? value, global::System.Collections.Generic.Dictionary<global::System.String, global::StrawberryShake.Upload?> files)
        {
            if (value is { } value_i)
            {
                MapFilesFromTypeTestInput(path, value_i, files);
            }
        }

        private void MapFilesFromArgumentObjectList(global::System.String path, global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput?>? value, global::System.Collections.Generic.Dictionary<global::System.String, global::StrawberryShake.Upload?> files)
        {
            if (value is { } value_i)
            {
                var path_counter = 0;
                foreach (var value_lt in value_i)
                {
                    var path_lt = path + "." + (path_counter++);
                    if (value_lt is { } value_lt_i)
                    {
                        MapFilesFromTypeTestInput(path_lt, value_lt_i, files);
                    }
                }
            }
        }

        private void MapFilesFromArgumentObjectNested(global::System.String path, global::System.Collections.Generic.IReadOnlyList<global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput?>?>? value, global::System.Collections.Generic.Dictionary<global::System.String, global::StrawberryShake.Upload?> files)
        {
            if (value is { } value_i)
            {
                var path_counter = 0;
                foreach (var value_lt in value_i)
                {
                    var path_lt = path + "." + (path_counter++);
                    if (value_lt is { } value_lt_i)
                    {
                        var path_lt_counter = 0;
                        foreach (var value_lt_lt in value_lt_i)
                        {
                            var path_lt_lt = path_lt + "." + (path_lt_counter++);
                            if (value_lt_lt is { } value_lt_lt_i)
                            {
                                MapFilesFromTypeTestInput(path_lt_lt, value_lt_lt_i, files);
                            }
                        }
                    }
                }
            }
        }

        public global::System.IObservable<global::StrawberryShake.IOperationResult<ITestUploadResult>> Watch(global::System.String? nonUpload, global::StrawberryShake.Upload? single, global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.Upload?>? list, global::System.Collections.Generic.IReadOnlyList<global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.Upload?>?>? nested, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput? @object, global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput?>? objectList, global::System.Collections.Generic.IReadOnlyList<global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput?>?>? objectNested, global::StrawberryShake.ExecutionStrategy? strategy = null)
        {
            var request = CreateRequest(nonUpload, single, list, nested, @object, objectList, objectNested);
            return _operationExecutor.Watch(request, strategy);
        }

        private global::StrawberryShake.OperationRequest CreateRequest(global::System.String? nonUpload, global::StrawberryShake.Upload? single, global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.Upload?>? list, global::System.Collections.Generic.IReadOnlyList<global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.Upload?>?>? nested, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput? @object, global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput?>? objectList, global::System.Collections.Generic.IReadOnlyList<global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput?>?>? objectNested)
        {
            var variables = new global::System.Collections.Generic.Dictionary<global::System.String, global::System.Object?>();
            variables.Add("nonUpload", FormatNonUpload(nonUpload));
            variables.Add("single", FormatSingle(single));
            variables.Add("list", FormatList(list));
            variables.Add("nested", FormatNested(nested));
            variables.Add("object", FormatObject(@object));
            variables.Add("objectList", FormatObjectList(objectList));
            variables.Add("objectNested", FormatObjectNested(objectNested));
            var files = new global::System.Collections.Generic.Dictionary<global::System.String, global::StrawberryShake.Upload?>();
            MapFilesFromArgumentSingle("variables.single", single, files);
            MapFilesFromArgumentList("variables.list", list, files);
            MapFilesFromArgumentNested("variables.nested", nested, files);
            MapFilesFromArgumentObject("variables.object", @object, files);
            MapFilesFromArgumentObjectList("variables.objectList", objectList, files);
            MapFilesFromArgumentObjectNested("variables.objectNested", objectNested, files);
            return CreateRequest(variables, files);
        }

        private global::StrawberryShake.OperationRequest CreateRequest(global::System.Collections.Generic.IReadOnlyDictionary<global::System.String, global::System.Object?>? variables, global::System.Collections.Generic.Dictionary<global::System.String, global::StrawberryShake.Upload?> files)
        {
            return new global::StrawberryShake.OperationRequest(id: TestUploadQueryDocument.Instance.Hash.Value, name: "TestUpload", document: TestUploadQueryDocument.Instance, strategy: global::StrawberryShake.RequestStrategy.Default, files: files, variables: variables);
        }

        private global::System.Object? FormatNonUpload(global::System.String? value)
        {
            if (value is null)
            {
                return value;
            }
            else
            {
                return _stringFormatter.Format(value);
            }
        }

        private global::System.Object? FormatSingle(global::StrawberryShake.Upload? value)
        {
            if (value is null)
            {
                return value;
            }
            else
            {
                return _uploadFormatter.Format(value);
            }
        }

        private global::System.Object? FormatList(global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.Upload?>? value)
        {
            if (value is null)
            {
                return value;
            }
            else
            {
                var value_list = new global::System.Collections.Generic.List<global::System.Object?>();
                foreach (var value_elm in value)
                {
                    if (value_elm is null)
                    {
                        value_list.Add(value_elm);
                    }
                    else
                    {
                        value_list.Add(_uploadFormatter.Format(value_elm));
                    }
                }

                return value_list;
            }
        }

        private global::System.Object? FormatNested(global::System.Collections.Generic.IReadOnlyList<global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.Upload?>?>? value)
        {
            if (value is null)
            {
                return value;
            }
            else
            {
                var value_list = new global::System.Collections.Generic.List<global::System.Object?>();
                foreach (var value_elm in value)
                {
                    if (value_elm is null)
                    {
                        value_list.Add(value_elm);
                    }
                    else
                    {
                        var value_elm_list = new global::System.Collections.Generic.List<global::System.Object?>();
                        foreach (var value_elm_elm in value_elm)
                        {
                            if (value_elm_elm is null)
                            {
                                value_elm_list.Add(value_elm_elm);
                            }
                            else
                            {
                                value_elm_list.Add(_uploadFormatter.Format(value_elm_elm));
                            }
                        }

                        value_list.Add(value_elm_list);
                    }
                }

                return value_list;
            }
        }

        private global::System.Object? FormatObject(global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput? value)
        {
            if (value is null)
            {
                return value;
            }
            else
            {
                return _testInputFormatter.Format(value);
            }
        }

        private global::System.Object? FormatObjectList(global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput?>? value)
        {
            if (value is null)
            {
                return value;
            }
            else
            {
                var value_list = new global::System.Collections.Generic.List<global::System.Object?>();
                foreach (var value_elm in value)
                {
                    if (value_elm is null)
                    {
                        value_list.Add(value_elm);
                    }
                    else
                    {
                        value_list.Add(_testInputFormatter.Format(value_elm));
                    }
                }

                return value_list;
            }
        }

        private global::System.Object? FormatObjectNested(global::System.Collections.Generic.IReadOnlyList<global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput?>?>? value)
        {
            if (value is null)
            {
                return value;
            }
            else
            {
                var value_list = new global::System.Collections.Generic.List<global::System.Object?>();
                foreach (var value_elm in value)
                {
                    if (value_elm is null)
                    {
                        value_list.Add(value_elm);
                    }
                    else
                    {
                        var value_elm_list = new global::System.Collections.Generic.List<global::System.Object?>();
                        foreach (var value_elm_elm in value_elm)
                        {
                            if (value_elm_elm is null)
                            {
                                value_elm_list.Add(value_elm_elm);
                            }
                            else
                            {
                                value_elm_list.Add(_testInputFormatter.Format(value_elm_elm));
                            }
                        }

                        value_list.Add(value_elm_list);
                    }
                }

                return value_list;
            }
        }

        global::StrawberryShake.OperationRequest global::StrawberryShake.IOperationRequestFactory.Create(global::System.Collections.Generic.IReadOnlyDictionary<global::System.String, global::System.Object?>? variables)
        {
            return CreateRequest(variables!, new global::System.Collections.Generic.Dictionary<global::System.String, global::StrawberryShake.Upload?>());
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.OperationServiceInterfaceGenerator
    /// <summary>
    /// Represents the operation service of the TestUpload GraphQL operation
    /// <code>
    /// query TestUpload(
    ///   $nonUpload: String
    ///   $single: Upload
    ///   $list: [Upload]
    ///   $nested: [[Upload]]
    ///   $object: TestInput
    ///   $objectList: [TestInput]
    ///   $objectNested: [[TestInput]]
    /// ) {
    ///   upload(nonUpload: $nonUpload, single: $single, list: $list, nested: $nested, object: $object, objectList: $objectList, objectNested: $objectNested)
    /// }
    /// </code>
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial interface ITestUploadQuery : global::StrawberryShake.IOperationRequestFactory
    {
        global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadQuery With(global::System.Action<global::StrawberryShake.OperationRequest> configure);
        global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadQuery WithRequestUri(global::System.Uri requestUri);
        global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadQuery WithHttpClient(global::System.Net.Http.HttpClient httpClient);
        global::System.Threading.Tasks.Task<global::StrawberryShake.IOperationResult<ITestUploadResult>> ExecuteAsync(global::System.String? nonUpload, global::StrawberryShake.Upload? single, global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.Upload?>? list, global::System.Collections.Generic.IReadOnlyList<global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.Upload?>?>? nested, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput? @object, global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput?>? objectList, global::System.Collections.Generic.IReadOnlyList<global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput?>?>? objectNested, global::System.Threading.CancellationToken cancellationToken = default);
        global::System.IObservable<global::StrawberryShake.IOperationResult<ITestUploadResult>> Watch(global::System.String? nonUpload, global::StrawberryShake.Upload? single, global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.Upload?>? list, global::System.Collections.Generic.IReadOnlyList<global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.Upload?>?>? nested, global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput? @object, global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput?>? objectList, global::System.Collections.Generic.IReadOnlyList<global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestInput?>?>? objectNested, global::StrawberryShake.ExecutionStrategy? strategy = null);
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ClientGenerator
    /// <summary>
    /// Represents the UploadScalarClient GraphQL client
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class UploadScalarClient : global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.IUploadScalarClient
    {
        private readonly global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadQuery _testUpload;
        public UploadScalarClient(global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadQuery testUpload)
        {
            _testUpload = testUpload ?? throw new global::System.ArgumentNullException(nameof(testUpload));
        }

        public static global::System.String ClientName => "UploadScalarClient";
        public global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadQuery TestUpload => _testUpload;
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ClientInterfaceGenerator
    /// <summary>
    /// Represents the UploadScalarClient GraphQL client
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial interface IUploadScalarClient
    {
        global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadQuery TestUpload { get; }
    }
}

namespace StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.State
{
    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultDataFactoryGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class TestUploadResultFactory : global::StrawberryShake.IOperationResultDataFactory<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.TestUploadResult>
    {
        private readonly global::StrawberryShake.IEntityStore _entityStore;
        public TestUploadResultFactory(global::StrawberryShake.IEntityStore entityStore)
        {
            _entityStore = entityStore ?? throw new global::System.ArgumentNullException(nameof(entityStore));
        }

        global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadResult);

        public TestUploadResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null)
        {
            if (snapshot is null)
            {
                snapshot = _entityStore.CurrentSnapshot;
            }

            if (dataInfo is TestUploadResultInfo info)
            {
                return new TestUploadResult(info.Upload);
            }

            throw new global::System.ArgumentException("TestUploadResultInfo expected.");
        }

        global::System.Object global::StrawberryShake.IOperationResultDataFactory.Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot)
        {
            return Create(dataInfo, snapshot);
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInfoGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class TestUploadResultInfo : global::StrawberryShake.IOperationResultDataInfo
    {
        private readonly global::System.Collections.Generic.IReadOnlyCollection<global::StrawberryShake.EntityId> _entityIds;
        private readonly global::System.UInt64 _version;
        public TestUploadResultInfo(global::System.String? upload, global::System.Collections.Generic.IReadOnlyCollection<global::StrawberryShake.EntityId> entityIds, global::System.UInt64 version)
        {
            Upload = upload;
            _entityIds = entityIds ?? throw new global::System.ArgumentNullException(nameof(entityIds));
            _version = version;
        }

        public global::System.String? Upload { get; }
        public global::System.Collections.Generic.IReadOnlyCollection<global::StrawberryShake.EntityId> EntityIds => _entityIds;
        public global::System.UInt64 Version => _version;

        public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version)
        {
            return new TestUploadResultInfo(Upload, _entityIds, version);
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.InputTypeStateInterfaceGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "0.0.0.0")]
    internal interface ITestInputInfo
    {
        global::System.Boolean IsBarSet { get; }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.InputTypeStateInterfaceGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "0.0.0.0")]
    internal interface IBarInputInfo
    {
        global::System.Boolean IsBazSet { get; }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.InputTypeStateInterfaceGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "0.0.0.0")]
    internal interface IBazInputInfo
    {
        global::System.Boolean IsFileSet { get; }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.JsonResultBuilderGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class TestUploadBuilder : global::StrawberryShake.OperationResultBuilder<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadResult>
    {
        private readonly global::StrawberryShake.IEntityStore _entityStore;
        private readonly global::StrawberryShake.IEntityIdSerializer _idSerializer;
        private readonly global::StrawberryShake.Serialization.ILeafValueParser<global::System.String, global::System.String> _stringParser;
        private readonly global::StrawberryShake.Serialization.ILeafValueParser<global::System.String, global::StrawberryShake.Upload> _uploadParser;
        public TestUploadBuilder(global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityIdSerializer idSerializer, global::StrawberryShake.IOperationResultDataFactory<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadResult> resultDataFactory, global::StrawberryShake.Serialization.ISerializerResolver serializerResolver)
        {
            _entityStore = entityStore ?? throw new global::System.ArgumentNullException(nameof(entityStore));
            _idSerializer = idSerializer ?? throw new global::System.ArgumentNullException(nameof(idSerializer));
            ResultDataFactory = resultDataFactory ?? throw new global::System.ArgumentNullException(nameof(resultDataFactory));
            _stringParser = serializerResolver.GetLeafValueParser<global::System.String, global::System.String>("String") ?? throw new global::System.ArgumentException("No serializer for type `String` found.");
            _uploadParser = serializerResolver.GetLeafValueParser<global::System.String, global::StrawberryShake.Upload>("Upload") ?? throw new global::System.ArgumentException("No serializer for type `Upload` found.");
        }

        protected override global::StrawberryShake.IOperationResultDataFactory<global::StrawberryShake.CodeGeneration.CSharp.Integration.UploadScalar.ITestUploadResult> ResultDataFactory { get; }

        protected override global::StrawberryShake.IOperationResultDataInfo BuildData(global::System.Text.Json.JsonElement obj)
        {
            var entityIds = new global::System.Collections.Generic.HashSet<global::StrawberryShake.EntityId>();
            global::StrawberryShake.IEntityStoreSnapshot snapshot = default !;
            _entityStore.Update(session =>
            {
                snapshot = session.CurrentSnapshot;
            });
            return new TestUploadResultInfo(Deserialize_String(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "upload")), entityIds, snapshot.Version);
        }

        private global::System.String? Deserialize_String(global::System.Text.Json.JsonElement? obj)
        {
            if (!obj.HasValue)
            {
                return null;
            }

            if (obj.Value.ValueKind == global::System.Text.Json.JsonValueKind.Null)
            {
                return null;
            }

            return _stringParser.Parse(obj.Value.GetString()!);
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.EntityIdFactoryGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class UploadScalarClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer
    {
        private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions()
        {
            Indented = false
        };
        public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj)
        {
            global::System.String __typename = obj.GetProperty("__typename").GetString()!;
            return __typename switch
            {
                _ => throw new global::System.NotSupportedException()};
        }

        public global::System.String Format(global::StrawberryShake.EntityId entityId)
        {
            return entityId.Name switch
            {
                _ => throw new global::System.NotSupportedException()};
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.StoreAccessorGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class UploadScalarClientStoreAccessor : global::StrawberryShake.StoreAccessor
    {
        public UploadScalarClientStoreAccessor(global::StrawberryShake.IOperationStore operationStore, global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityIdSerializer entityIdSerializer, global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationRequestFactory> requestFactories, global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationResultDataFactory> resultDataFactories) : base(operationStore, entityStore, entityIdSerializer, requestFactories, resultDataFactories)
        {
        }
    }
}


